<template>
  <cjui-page-panel header="右键菜单">
    <template #intro>
      右键点击下方黑色区域。
    </template>
    
    <div class="demo" @contextmenu.prevent="(event) => clickRightEvent(event)"></div>

    <cjui-mouse-box :event="rightEvent">
      <p>MouseBoxMouseBoxMouseBoxMouseBoxMouseBoxMouseBox</p>
      <p>MouseBoxMouseBoxMouseBoxMouseBoxMouseBoxMouseBox</p>
      <p>MouseBoxMouseBoxMouseBoxMouseBoxMouseBoxMouseBox</p>
    </cjui-mouse-box>
  </cjui-page-panel>
</template>

<script lang="ts" setup>
const rightEvent = ref({})
function clickRightEvent(e: MouseEvent) {
  rightEvent.value = e;
}
</script>

<style lang="scss" scoped>
.demo {
  width: 100%;
  height: 300px;
  background-color: #333;
}
</style>
